<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>ng Repeat 遍历显示集合数据</title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>

	<body ng-app="myapp" ng-controller="mycontroller">
		<table width="100%" border="1">
			<tr>
				<th>序号</th>
				<th>商品名称</th>
				<th>价格</th>
				<th>数量</th>
			</tr>
			<tr ng-repeat="product in products">
				<td>{{$index+1}}</td>
				<td>{{product.name}}</td>
				<td>{{product.price}}</td>
				<td>{{product.count}}</td>
			</tr>
		</table>
	</body>

	<script type="text/javascript">
		var myapp = angular.module("myapp", []);
		myapp.controller("mycontroller", ["$scope", function($scope) {
			$scope.products = [{
					name: '冰箱',
					price: 1000,
					count: 66
				}, {
					name: '松子',
					price: 10,
					count: 999
				}

			];

		}])
	</script>

</html>